//
//  ViewController.swift
//  代码
//
//  Created by 崔顺建 on 16/8/7.
//  Copyright © 2016年 cui. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let v = UIView(frame: CGRect(x: 100, y: 100, width: 200, height: 200))
        v.backgroundColor = UIColor.redColor()
        view.addSubview(v)
        
        let button = UIButton(type: .ContactAdd)
        button.backgroundColor = UIColor.yellowColor()
        v.addSubview(button)
        
        button.addTarget(self, action: Selector("buttonClick"), forControlEvents: .TouchUpInside)
        
       }
    func buttonClick() {
    
    print("hahahahah")
    
    }
    

}

